#ifndef __FSMAILOGIC_H__
#define __FSMAILOGIC_H__

#include "FsmAIDef.h"

class FsmAI;
class EventParam;

class FsmAILogic {
public:
    FsmAILogic() {};
    FsmAILogic(FsmAI* ai): m_AI(ai) {};
    virtual ~FsmAILogic() {};
    virtual FSM_AI_LOGIC getType() = 0;
    virtual void onEvent(FSM_AI_EVENT event, EventParam* param) = 0;
    virtual void enter() = 0;
    virtual void leave() = 0;
    virtual void pulse() = 0;
protected:
    FsmAI* m_AI;
};

class FsmAILogicIdle : public FsmAILogic {
public:
    FsmAILogicIdle(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicIdle() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_IDLE;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};


class FsmAILogicChase : public FsmAILogic  {
public:
    FsmAILogicChase(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicChase() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_CHASE;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicAttack : public FsmAILogic  {
public:
    FsmAILogicAttack(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicAttack() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_ATTACK;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicBack : public FsmAILogic  {
public:
    FsmAILogicBack(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicBack() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_BACK;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicFlee : public FsmAILogic  {
public:
    FsmAILogicFlee(FsmAI* ai): FsmAILogic(ai) {};
    ~FsmAILogicFlee() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_FLEE;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicDisperse : public FsmAILogic  {
public:
    FsmAILogicDisperse(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicDisperse() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_DISPERSE;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicTeamFollow : public FsmAILogic  {
public:
    FsmAILogicTeamFollow(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicTeamFollow() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_TEAM_FOLLOW;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};

class FsmAILogicPlayAct : public FsmAILogic  {
public:
    FsmAILogicPlayAct(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicPlayAct() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_PLAY_ACT;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};


class FsmAILogicScaring : public FsmAILogic  {
public:
    FsmAILogicScaring(FsmAI* ai): FsmAILogic(ai) {};
    virtual ~FsmAILogicScaring() {};
    virtual FSM_AI_LOGIC getType() {return FSM_AI_LOGIC::AI_LOGIC_SCARING;};
    virtual void enter();
    virtual void leave();
    virtual void pulse();
};
#endif